const { ccclass, property, menu, requireComponent } = cc._decorator;

@ccclass
@menu("汉化/文字")
@requireComponent(cc.Label)
export default class LabelCN extends cc.Component {
    @property({displayName:"中文文本"})
    textCN = "";

    @property({ displayName: "偏移位置量" })
    offset: cc.Vec2 = cc.Vec2.ZERO;

    private theLable: cc.Label = null;
    protected onLoad(): void {
        if (cc.sys.languageCode.includes("zh") == false)
            return
        this.theLable = this.getComponent(cc.Label);
        this.theLable.string = this.textCN
        this.node.setPosition(this.node.getPosition().add(this.offset));
    }
}
